/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/* 
 * Copyright (c) 2009 City University of Hong Kong
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License m_version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * Author: Wilson Thong (wilsonwk@ee.cityu.edu.hk) 
 */
#ifndef BMSN_ROUTING_MANAGER_H
#define BMSN_ROUTING_MANAGER_H

#include "jitter-sim-include.h"
#include "bmsn-routing.h"

namespace ns3 {
namespace eecityu {

/**
 * \brief Convert an Ipv4RoutingTableEntry object into an Ipv4Route object
 * \param in An routing table entry
 * \param ipv4 An ipv4 object associated with a node
 * \return The output Ipv4Route object
 */
Ptr<Ipv4Route>
GetIpv4RouteFrom (const Ipv4RoutingTableEntry& in, Ptr<Ipv4Route> preferredRoute, Ptr<Ipv4> ipv4);

/**
 * \brief Install a BMSN routing protocol to all nodes of a BMSN topology
 */
class BmsnRoutingManager
{
public:

  /**
   * \brief Enable the nodes of the BMSN topolog to
   * run the BMSN routing protocol.
   *
   * (Implemenation code are copied and modified from 
   * GlobalRouteManagerImpl::SelectRouterNodes (NodeContainer c) )
   *
   * \param bmsnNet The BMSN topology
   * \param enableDeflect Set to true to enable deflection routing 
   * on all nodes; false otherwise
   */
  static void PopulateRoutingTables (const BmsnTopology& bmsnNet, bool enableDeflect = true);

private:
};

} // namespace eecityu
} // namespace ns3

#endif // #ifndef BMSN_ROUTING_MANAGER_H
